package com.test.ddd.infrastructure.eventbus;

import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executor;

/**
 * @author csruan
 * @Copyright
 * @Description
 * @date 2021/9/9 13:57
 */
@Configuration
public class EventBusConfig {
	@Autowired
	private Executor syncExecutor;

	@Bean
	public EventBus eventBus() {
		return new AsyncEventBus(syncExecutor);
	}
}
